$p_count= 0;
$np = 8;
$b_cols = 120;

while ($p_count < $np) {
	$table[$p_count] = 0;

	for ($i = 0; $i < $p_count; ++$i) {
		if ($table[$i] < $b_cols - 1) {
			$table[$i] = $table[$i] + 1;
		}
	}

	print "[\t";
	for ($i = 0; $i < $np; ++$i) {
		print $table[$i], ",\t";
	}
	print "]\n";

	++$p_count;
}

while ($table[$np-1] < $b_cols - 1) {
	for ($i = 0; $i < $np; ++$i) {
		if ($table[$i] < $b_cols - 1) {
			++$table[$i];
		}
	}

	print "[\t";
	for ($i = 0; $i < $np; ++$i) {
		print $table[$i], ",\t";
	}
	print "]\n";
}
